<!--
  
   Shared.xaml
  
   Copyright (c) 2007 Mike Strobel
  
   This source code is subject to the terms of the Microsoft Reciprocal License (Ms-RL).
   For details, see <http://www.opensource.org/licenses/ms-rl.html>.
  
   All other rights reserved.
  
  -->
<ResourceDictionary xmlns="http://schemas.microsoft.com/netfx/2007/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">

  <!--
    CARDASSIAN UI THEME
    
    Colors
    ======
    Light Gold:   #FFFEFBB9
    Dark Gold:    #FFC8871E
    Light Green:  #FF23C389
    Dark Green:   #FF017A4D
  -->

  <SolidColorBrush x:Key="GoldTextBrush"
                   Color="#FFFEFBB9"/>

  <SolidColorBrush x:Key="BrownTextBrush"
                   Color="#FFC17808"/>

  <LinearGradientBrush x:Key="GoldGradient_Top_Bottom"
                       StartPoint="0.5,0.0"
                       EndPoint="0.5,1.0">
    <GradientStop Offset="0.0"
                  Color="#FFFEFBB9"/>
    <GradientStop Offset="1.0"
                  Color="#FFC8871E"/>
  </LinearGradientBrush>

  <LinearGradientBrush x:Key="GoldGradient_Bottom_Top"
                       StartPoint="0.5,1.0"
                       EndPoint="0.5,0.0">
    <GradientStop Offset="0.0"
                  Color="#FFFEFBB9"/>
    <GradientStop Offset="1.0"
                  Color="#FFC8871E"/>
  </LinearGradientBrush>

  <LinearGradientBrush x:Key="GoldGradient_Left_Right"
                       StartPoint="0.0,0.5"
                       EndPoint="1.0,0.5">
    <GradientStop Offset="0.0"
                  Color="#FFFEFBB9"/>
    <GradientStop Offset="1.0"
                  Color="#FFC8871E"/>
  </LinearGradientBrush>

  <LinearGradientBrush x:Key="GoldGradient_Right_Left"
                       StartPoint="1.0,0.5"
                       EndPoint="0.0,0.5">
    <GradientStop Offset="0.0"
                  Color="#FFFEFBB9"/>
    <GradientStop Offset="1.0"
                  Color="#FFC8871E"/>
  </LinearGradientBrush>

  <LinearGradientBrush x:Key="GreenGradient_Top_Bottom"
                       StartPoint="0.5,0.0"
                       EndPoint="0.5,1.0">
    <GradientStop Offset="0.0"
                  Color="#FF23C389"/>
    <GradientStop Offset="1.0"
                  Color="#FF017A4D"/>
  </LinearGradientBrush>

  <LinearGradientBrush x:Key="GreenGradient_Bottom_Top"
                       StartPoint="0.5,1.0"
                       EndPoint="0.5,0.0">
    <GradientStop Offset="0.0"
                  Color="#FF23C389"/>
    <GradientStop Offset="1.0"
                  Color="#FF017A4D"/>
  </LinearGradientBrush>

  <LinearGradientBrush x:Key="GreenGradient_Left_Right"
                       StartPoint="0.0,0.5"
                       EndPoint="1.0,0.5">
    <GradientStop Offset="0.0"
                  Color="#FF23C389"/>
    <GradientStop Offset="1.0"
                  Color="#FF017A4D"/>
  </LinearGradientBrush>

  <LinearGradientBrush x:Key="GreenGradient_Right_Left"
                       StartPoint="1.0,0.5"
                       EndPoint="0.0,0.5">
    <GradientStop Offset="0.0"
                  Color="#FF23C389"/>
    <GradientStop Offset="1.0"
                  Color="#FF017A4D"/>
  </LinearGradientBrush>

  <LinearGradientBrush x:Key="HoverGreenGradient_Top_Bottom"
                       StartPoint="0.5,0.0"
                       EndPoint="0.5,1.0">
    <GradientStop Offset="0.0"
                  Color="#FF28E09D"/>
    <GradientStop Offset="1.0"
                  Color="#FF03A86C"/>
  </LinearGradientBrush>

  <LinearGradientBrush x:Key="HoverGoldGradient_Top_Bottom"
                       StartPoint="0.5,0.0"
                       EndPoint="0.5,1.0">
    <GradientStop Offset="0.0"
                  Color="#FFFFEFA8"/>
    <GradientStop Offset="1.0"
                  Color="#FFE39922"/>
  </LinearGradientBrush>

  <Style x:Key="CardieTrapezoidContentControl"
         TargetType="{x:Type ContentControl}">
    <Setter Property="Template">
      <Setter.Value>
        <ControlTemplate TargetType="{x:Type ContentControl}">
          <DockPanel LastChildFill="True"
                     Margin="{TemplateBinding Margin}">
            <Rectangle DockPanel.Dock="Left"
                       Width="18"
                       Height="28">
              <Rectangle.Fill>
                <DrawingBrush Stretch="Fill">
                  <DrawingBrush.Drawing>
                    <GeometryDrawing Brush="{Binding Path=Background, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type ContentControl}, AncestorLevel=1}}"
                                     Geometry="F1 M 0,0 5,13 10,13 16,28 18,28 18,5 10,5 Z"/>
                  </DrawingBrush.Drawing>
                </DrawingBrush>
              </Rectangle.Fill>
            </Rectangle>
            <Rectangle DockPanel.Dock="Right"
                       Width="18"
                       Height="28">
              <Rectangle.Fill>
                <DrawingBrush Stretch="Fill">
                  <DrawingBrush.Drawing>
                    <GeometryDrawing Brush="{Binding Path=Background, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type ContentControl}, AncestorLevel=1}}"
                                     Geometry="F1 M 18,0 13,13 8,13 2,28 0,28 0,5 8,5 Z"/>
                  </DrawingBrush.Drawing>
                </DrawingBrush>
              </Rectangle.Fill>
            </Rectangle>
            <Grid Margin="-1,0,-1,0">
              <Border x:Name="ContentBorder"
                      Height="23"
                      Margin="0,5,0,0"
                      ClipToBounds="True">
                <Grid>
                  <Border Height="28"
                          Margin="0,-5,0,0"
                          Background="{TemplateBinding Background}"/>
                  <ContentPresenter Margin="4,0,4,0"
                                    HorizontalAlignment="Center"
                                    VerticalAlignment="Center"/>
                </Grid>
              </Border>
            </Grid>
          </DockPanel>
        </ControlTemplate>
      </Setter.Value>
    </Setter>
  </Style>

  <Style x:Key="CardieInvertedTrapezoidContentControl"
         TargetType="{x:Type ContentControl}">
    <Setter Property="Template">
      <Setter.Value>
        <ControlTemplate TargetType="{x:Type ContentControl}">
          <DockPanel LastChildFill="True"
                     Margin="{TemplateBinding Margin}">
            <Rectangle DockPanel.Dock="Left"
                       Width="18"
                       Height="28">
              <Rectangle.Fill>
                <DrawingBrush Stretch="Fill">
                  <DrawingBrush.Drawing>
                    <GeometryDrawing Brush="{Binding Path=Background, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type ContentControl}, AncestorLevel=1}}"
                                     Geometry="F1 M 0,28 5,16 10,16 16,0 18,0 18,23 10,23 Z"/>
                  </DrawingBrush.Drawing>
                </DrawingBrush>
              </Rectangle.Fill>
            </Rectangle>
            <Rectangle DockPanel.Dock="Right"
                       Width="18"
                       Height="28">
              <Rectangle.Fill>
                <DrawingBrush Stretch="Fill">
                  <DrawingBrush.Drawing>
                    <GeometryDrawing Brush="{Binding Path=Background, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type ContentControl}, AncestorLevel=1}}"
                                     Geometry="F1 M 18,28 13,16 8,16 2,0 0,0 0,23 8,23 Z"/>
                  </DrawingBrush.Drawing>
                </DrawingBrush>
              </Rectangle.Fill>
            </Rectangle>
            <Grid Margin="-1,0,-1,0">
              <Border x:Name="ContentBorder"
                      Height="23"
                      Margin="0,0,0,5"
                      ClipToBounds="True">
                <Grid>
                  <Border Height="28"
                          Margin="0,0,0,-5"
                          Background="{TemplateBinding Background}"/>
                  <ContentPresenter Margin="4,0,4,0"
                                    HorizontalAlignment="Center"
                                    VerticalAlignment="Center"/>
                </Grid>
              </Border>
            </Grid>
          </DockPanel>
        </ControlTemplate>
      </Setter.Value>
    </Setter>
  </Style>

  <Style x:Key="CardieGreenButtonStyle"
         TargetType="{x:Type ButtonBase}">
    <Setter Property="SnapsToDevicePixels"
            Value="True"/>
    <Setter Property="FontSize"
            Value="12pt"/>
    <Setter Property="FontWeight"
            Value="Bold"/>
    <Setter Property="FontFamily"
            Value="{DynamicResource ParagraphFont}"/>
    <Setter Property="MaxHeight"
            Value="28"/>
    <Setter Property="MinWidth"
            Value="36"/>
    <Setter Property="Background"
            Value="{StaticResource GreenGradient_Top_Bottom}"/>
    <Setter Property="Template">
      <Setter.Value>
        <ControlTemplate TargetType="{x:Type ButtonBase}">
          <ContentControl Content="{TemplateBinding Content}"
                          Margin="{TemplateBinding Margin}"
                          Style="{StaticResource CardieTrapezoidContentControl}"
                          Background="{TemplateBinding Background}"/>
          <ControlTemplate.Triggers>
            <Trigger Property="Selector.IsSelected"
                     Value="True">
              <Setter Property="Background"
                      Value="{StaticResource GoldGradient_Top_Bottom}"/>
            </Trigger>
            <MultiTrigger>
              <MultiTrigger.Conditions>
                <Condition Property="IsMouseOver"
                           Value="True"/>
                <Condition Property="Selector.IsSelected"
                           Value="True"/>
              </MultiTrigger.Conditions>
              <Setter Property="Background"
                      Value="{StaticResource HoverGoldGradient_Top_Bottom}"/>
            </MultiTrigger>
            <MultiTrigger>
              <MultiTrigger.Conditions>
                <Condition Property="IsMouseOver"
                           Value="True"/>
                <Condition Property="Selector.IsSelected"
                           Value="False"/>
              </MultiTrigger.Conditions>
              <Setter Property="Background"
                      Value="{StaticResource HoverGreenGradient_Top_Bottom}"/>
            </MultiTrigger>
            <MultiTrigger>
              <MultiTrigger.Conditions>
                <Condition Property="IsPressed"
                           Value="True"/>
                <Condition Property="Selector.IsSelected"
                           Value="True"/>
              </MultiTrigger.Conditions>
              <Setter Property="Background"
                      Value="{StaticResource GoldGradient_Bottom_Top}"/>
            </MultiTrigger>
            <MultiTrigger>
              <MultiTrigger.Conditions>
                <Condition Property="IsPressed"
                           Value="True"/>
                <Condition Property="Selector.IsSelected"
                           Value="False"/>
              </MultiTrigger.Conditions>
              <Setter Property="Background"
                      Value="{StaticResource GreenGradient_Bottom_Top}"/>
            </MultiTrigger>
          </ControlTemplate.Triggers>
        </ControlTemplate>
      </Setter.Value>
    </Setter>
  </Style>

  <Style x:Key="CardieInvertedGreenButtonStyle"
         TargetType="{x:Type ButtonBase}">
    <Setter Property="SnapsToDevicePixels"
            Value="True"/>
    <Setter Property="FontSize"
            Value="12pt"/>
    <Setter Property="FontWeight"
            Value="Bold"/>
    <Setter Property="FontFamily"
            Value="{DynamicResource ParagraphFont}"/>
    <Setter Property="MaxHeight"
            Value="28"/>
    <Setter Property="MinWidth"
            Value="36"/>
    <Setter Property="Background"
            Value="{StaticResource GreenGradient_Top_Bottom}"/>
    <Setter Property="Template">
      <Setter.Value>
        <ControlTemplate TargetType="{x:Type ButtonBase}">
          <ContentControl Content="{TemplateBinding Content}"
                          Margin="{TemplateBinding Margin}"
                          Style="{StaticResource CardieInvertedTrapezoidContentControl}"
                          Background="{TemplateBinding Background}"/>
          <ControlTemplate.Triggers>
            <Trigger Property="Selector.IsSelected"
                     Value="True">
              <Setter Property="Background"
                      Value="{StaticResource GoldGradient_Top_Bottom}"/>
            </Trigger>
            <MultiTrigger>
              <MultiTrigger.Conditions>
                <Condition Property="IsMouseOver"
                           Value="True"/>
                <Condition Property="Selector.IsSelected"
                           Value="True"/>
              </MultiTrigger.Conditions>
              <Setter Property="Background"
                      Value="{StaticResource HoverGoldGradient_Top_Bottom}"/>
            </MultiTrigger>
            <MultiTrigger>
              <MultiTrigger.Conditions>
                <Condition Property="IsMouseOver"
                           Value="True"/>
                <Condition Property="Selector.IsSelected"
                           Value="False"/>
              </MultiTrigger.Conditions>
              <Setter Property="Background"
                      Value="{StaticResource HoverGreenGradient_Top_Bottom}"/>
            </MultiTrigger>
            <MultiTrigger>
              <MultiTrigger.Conditions>
                <Condition Property="IsPressed"
                           Value="True"/>
                <Condition Property="Selector.IsSelected"
                           Value="True"/>
              </MultiTrigger.Conditions>
              <Setter Property="Background"
                      Value="{StaticResource GoldGradient_Bottom_Top}"/>
            </MultiTrigger>
            <MultiTrigger>
              <MultiTrigger.Conditions>
                <Condition Property="IsPressed"
                           Value="True"/>
                <Condition Property="Selector.IsSelected"
                           Value="False"/>
              </MultiTrigger.Conditions>
              <Setter Property="Background"
                      Value="{StaticResource GreenGradient_Bottom_Top}"/>
            </MultiTrigger>
          </ControlTemplate.Triggers>
        </ControlTemplate>
      </Setter.Value>
    </Setter>
  </Style>

  <Style x:Key="CardieBorderButtonStyle"
         TargetType="{x:Type ButtonBase}"
         BasedOn="{StaticResource CardieGreenButtonStyle}">
    <Setter Property="Margin"
            Value="-2,0,-2,0"/>
  </Style>

  <Style x:Key="CardieAltBorderButtonStyle"
         TargetType="{x:Type ButtonBase}"
         BasedOn="{StaticResource CardieInvertedGreenButtonStyle}">
    <Setter Property="Margin"
            Value="-2,0,-2,0"/>
  </Style>

</ResourceDictionary>